package cn.itrip.auth.service;


import org.springframework.mail.MailMessage;
import org.springframework.mail.MailSender;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service("mailService")
public class MailServiceImpl implements MailService{
    @Resource
    private MailMessage mailMessage;
    @Resource
    private MailSender mailSender;

    @Override
    public void sendActivationMail(String mailTo, String activationCode) throws Exception {
            mailMessage.setTo(mailTo);
            mailMessage.setText("你的激活码是"+activationCode);
            mailSender.send((SimpleMailMessage) mailMessage);
    }
}
